package it.ap.sa.acqua.dao.model;
// Generated 23-ago-2017 17.05.29 by Hibernate Tools 4.3.1.Final

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Parameter;

/**
 * TUserProfile generated by hbm2java
 */
@DynamicUpdate
@Cache(region = "it.eng.db.TUserProfile", usage = CacheConcurrencyStrategy.READ_WRITE)
@Entity
@Table(name = "t_user_profile", schema = "public")
public class TUserProfile implements java.io.Serializable {

	private long id;

	private TUser TUser;

	private String type;

	public TUserProfile() {
	}

	public TUserProfile(TUser TUser) {
		this.TUser = TUser;
	}

	public TUserProfile(TUser TUser, String type) {
		this.TUser = TUser;
		this.type = type;
	}

	@GenericGenerator(name = "generator", strategy = "foreign", parameters = @Parameter(name = "property", value = "TUser"))
	@Id
	@GeneratedValue(generator = "generator")

	@Column(name = "id", unique = true, nullable = false)
	public long getId() {
		return this.id;
	}

	public void setId(long id) {
		this.id = id;
	}

	@OneToOne(fetch = FetchType.LAZY)
	@PrimaryKeyJoinColumn
	public TUser getTUser() {
		return this.TUser;
	}

	public void setTUser(TUser TUser) {
		this.TUser = TUser;
	}

	@Column(name = "type", length = 15)
	public String getType() {
		return this.type;
	}

	public void setType(String type) {
		this.type = type;
	}

	/**
	 * toString
	 * @return String
	 */
	public String toString() {
		StringBuffer buffer = new StringBuffer();

		buffer.append(getClass().getName()).append("@").append(Integer.toHexString(hashCode())).append(" [");
		buffer.append("id").append("='").append(getId()).append("' ");
		buffer.append("TUser").append("='").append(getTUser()).append("' ");
		buffer.append("type").append("='").append(getType()).append("' ");
		buffer.append("]");

		return buffer.toString();
	}

}
